package com.ds.springboot.mapper;

import com.ds.springboot.pojo.Department;
import org.apache.ibatis.annotations.*;

/**
 * @program: springboot-1-cache
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-05-17
 **/
public interface DeptMapper {
    @Select("select * from department where id = #{id}")
    Department getById(Integer id);

    @Update("update department set departmentName=#{departmentName} where id = #{id}")
    int update(Department department);

    @Options(keyProperty = "id",useGeneratedKeys = true)
    @Insert("insert into department(departmentName) values(#{departmentName})")
    int add(Department department);

    @Delete("delete from department where id = #{id}")
    int del(Integer id);
}
